﻿@using CodeCamp.Models.Shared
@model CodeCamp.Models.Email.MailCampaignEditViewModel

@{
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Edit Email Campaign");
    }
    else
    {
        ViewBag.Title = "Code Camp | Edit Email Campaign";
    }
}

@section headaddon {
<style>
    #EmailView
    {
        width: 30em;
    }
    #Subject
    {
        width: 30em;
    }
    #ReplyToAddress
    {
        width: 30em;
    }
    .editor-label
    {
        margin-top: 10px;
        width: 40em;
    }
    fieldset label 
    {
        width: 40em;
    }
</style>
}

<h2>@Model.EventShortName - Edit Email Campaign</h2>

@Html.ActionLink("Campaigns List", "EmailCampaigns")
@if (Model.Campaign != null)
{
    <text> | </text>@Html.ActionLink("List Emails", "EmailCampaignEmailList", new { eventName = Model.EventShortName, id = Model.Campaign.Id })
    if (Model.Campaign.Status != CodeCamp.Model.EmailCampaign.EmailCampaignStatus.Completed)
    {
    <text> | </text>@Html.ActionLink("Add Email", "EmailCampaignAddEmail", new { eventName = Model.EventShortName, id = Model.Campaign.Id })
    }
}<br />

@if (Model.Campaign != null)
{
    <div style="min-height:200px;">
    @if (Model.CanEditCampaignConfiguration)
    {
    @Html.Partial("EmailCampaignEditPartial", Model.Campaign)
    }
    else
    {
    @Html.Partial("EmailCampaignEditStatusPartial", Model.Campaign)
    }
    </div>
}

@section sidebar {
    @if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
    {
    <div id="eventTagsContainer" class="widget rounded-10">
    <ul>
        <li>@Html.ActionLink("Back to Email Home", "Index")</li>
        <li>@Html.ActionLink("Campaigns", "EmailCampaigns")
            <ul>
                <li>&nbsp;&nbsp;<i>Edit Email Campaign</i></li>
            </ul>
        </li>
        <li>@Html.ActionLink("Recent Emails", "RecentEmails")</li>
        <li>
            Email Tests:
            <ul>
                <li>@Html.ActionLink("Basic Test", "TestBasicMail")</li>
            </ul>
        </li>
    </ul>
    </div>
    }
}
